from itertools import accumulate

# 请在此输入您的代码
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

prefix_a = [0] + list(accumulate(a))
prefix_b = [0] + list(accumulate(b))
# 前一段用a
ans = prefix_a[-1]
for mid in range(n):
    # (0,i)用a
    ans = min(ans, prefix_a[mid] + prefix_b[-1] - prefix_b[mid])
for mid in range(n):
    ans = min(ans, prefix_b[mid] + prefix_a[-1] - prefix_a[mid])
print(ans)
